agora inbox for [email protected]  
help / color / mirror / Atom feed
Add json_object(text[], json[])?
1933+ messages / 6 participants
[nested] [flat]

* Add json_object(text[], json[])?
@ 2019-10-24 15:17 Paul Jungwirth <[email protected]>
  2019-10-24 15:42 ` Re: Add json_object(text[], json[])? Nikita Glukhov <[email protected]>
  2019-10-24 15:52 ` Re: Add json_object(text[], json[])? Tom Lane <[email protected]>
  0 siblings, 2 replies; 1933+ messages in thread

From: Paul Jungwirth @ 2019-10-24 15:17 UTC (permalink / raw)
  To: pgsql-hackers

Hello,

I noticed that our existing 2-param json{,b}_object functions take 
text[] for both keys and values, so they are only able to build 
one-layer-deep JSON objects. I'm interested in adding json{,b}_object 
functions that take text[] for the keys and json{,b}[] for the values. 
It would otherwise behave the same as json_object(text[], text[]) (e.g. 
re NULL handling). Does that seem worthwhile to anyone?

I'll share my specific problem where I felt I could use this function, 
although you can stop reading here if that isn't interesting to you. :-) 
I was building a jsonb_dasherize(j jsonb) function, which converts 
snake_case JSON keys into dashed-case JSON keys. (It's because of a 
Javascript framework.... :-) My function needs to walk the whole JSON 
structure, doing this recursively when it sees objects inside arrays or 
other objects. Here is the definition, including a comment where my 
proposed jsonb_object would have helped:

CREATE FUNCTION jsonb_dasherize(j jsonb)
RETURNS jsonb
IMMUTABLE
AS
$$
DECLARE
t text;
key text;
val jsonb;
ret jsonb;
BEGIN
   t := jsonb_typeof(j);
   IF t = 'object' THEN
     -- So close! If only jsonb_object took text[] and jsonb[] params....
     -- SELECT  jsonb_object(
     --           array_agg(dasherize_key(k)),
     --           array_agg(jsonb_dasherize(v)))
     -- FROM    jsonb_each(j) AS t(k, v);
     ret := '{}';
     FOR key, val IN SELECT * FROM jsonb_each(j) LOOP
       ret := jsonb_set(ret,
                        array[REPLACE(key, '_', '-')],
                        jsonb_dasherize(val), true);
     END LOOP;
     RETURN ret;
   ELSIF t = 'array' THEN
     SELECT  COALESCE(jsonb_agg(jsonb_dasherize(elem)), '[]')
     INTO    ret
     FROM    jsonb_array_elements(j) AS t(elem);
     RETURN ret;
   ELSIF t IS NULL THEN
     -- This should never happen internally
     -- but only from a passed-in NULL.
     RETURN NULL;
   ELSE
     -- string/number/null:
     RETURN j;
   END IF;
END;
$$
LANGUAGE plpgsql;

I also tried a recursive CTE there using jsonb_set, but it was too late 
at night for me to figure that one out. :-)

It seems like a json-taking json_object would be just what I needed. And 
in general I was surprised that Postgres didn't have a more convenient 
way to build multi-layer JSON. I'm happy to add this myself if other 
folks want it.

Regards,

-- 
Paul              ~{:-)
[email protected]





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

* Re: Add json_object(text[], json[])?
  2019-10-24 15:17 Add json_object(text[], json[])? Paul Jungwirth <[email protected]>
@ 2019-10-24 15:42 ` Nikita Glukhov <[email protected]>
  2019-10-24 16:46   ` Re: Add json_object(text[], json[])? Paul A Jungwirth <[email protected]>
  1 sibling, 1 reply; 1933+ messages in thread

From: Nikita Glukhov @ 2019-10-24 15:42 UTC (permalink / raw)
  To: Paul Jungwirth <[email protected]>; pgsql-hackers


On 24.10.2019 18:17, Paul Jungwirth wrote:
> Hello,
>
> I noticed that our existing 2-param json{,b}_object functions take 
> text[] for both keys and values, so they are only able to build 
> one-layer-deep JSON objects. I'm interested in adding json{,b}_object 
> functions that take text[] for the keys and json{,b}[] for the values. 
> It would otherwise behave the same as json_object(text[], text[]) 
> (e.g. re NULL handling). Does that seem worthwhile to anyone?
>
> I'll share my specific problem where I felt I could use this function, 
> although you can stop reading here if that isn't interesting to you. 
> :-) I was building a jsonb_dasherize(j jsonb) function, which converts 
> snake_case JSON keys into dashed-case JSON keys. (It's because of a 
> Javascript framework.... :-) My function needs to walk the whole JSON 
> structure, doing this recursively when it sees objects inside arrays 
> or other objects. Here is the definition, including a comment where my 
> proposed jsonb_object would have helped:
>
> CREATE FUNCTION jsonb_dasherize(j jsonb)
> RETURNS jsonb
> IMMUTABLE
> AS
> $$
> DECLARE
> t text;
> key text;
> val jsonb;
> ret jsonb;
> BEGIN
>   t := jsonb_typeof(j);
>   IF t = 'object' THEN
>     -- So close! If only jsonb_object took text[] and jsonb[] params....
>     -- SELECT  jsonb_object(
>     --           array_agg(dasherize_key(k)),
>     --           array_agg(jsonb_dasherize(v)))
>     -- FROM    jsonb_each(j) AS t(k, v);
>     ret := '{}';
>     FOR key, val IN SELECT * FROM jsonb_each(j) LOOP
>       ret := jsonb_set(ret,
>                        array[REPLACE(key, '_', '-')],
>                        jsonb_dasherize(val), true);
>     END LOOP;
>     RETURN ret;
>   ELSIF t = 'array' THEN
>     SELECT  COALESCE(jsonb_agg(jsonb_dasherize(elem)), '[]')
>     INTO    ret
>     FROM    jsonb_array_elements(j) AS t(elem);
>     RETURN ret;
>   ELSIF t IS NULL THEN
>     -- This should never happen internally
>     -- but only from a passed-in NULL.
>     RETURN NULL;
>   ELSE
>     -- string/number/null:
>     RETURN j;
>   END IF;
> END;
> $$
> LANGUAGE plpgsql;
>
> I also tried a recursive CTE there using jsonb_set, but it was too 
> late at night for me to figure that one out. :-)
>
> It seems like a json-taking json_object would be just what I needed. 
> And in general I was surprised that Postgres didn't have a more 
> convenient way to build multi-layer JSON. I'm happy to add this myself 
> if other folks want it.
>
> Regards,
>

You can simply use jsonb_object_agg() to build a jsonb object from a sequence
of transformed key-value pairs:

SELECT COALESCE(jsonb_object_agg(REPLACE(k, '_', '-'),
                                  jsonb_dasherize(v)), '{}')
INTO ret
FROM jsonb_each(j) AS t(k, v);

-- 
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


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

* Re: Add json_object(text[], json[])?
  2019-10-24 15:17 Add json_object(text[], json[])? Paul Jungwirth <[email protected]>
  2019-10-24 15:42 ` Re: Add json_object(text[], json[])? Nikita Glukhov <[email protected]>
@ 2019-10-24 16:46   ` Paul A Jungwirth <[email protected]>
  2019-10-25 13:40     ` Re: Add json_object(text[], json[])? Andrew Dunstan <[email protected]>
  0 siblings, 1 reply; 1933+ messages in thread

From: Paul A Jungwirth @ 2019-10-24 16:46 UTC (permalink / raw)
  To: Nikita Glukhov <[email protected]>; +Cc: pgsql-hackers

On Thu, Oct 24, 2019 at 8:45 AM Nikita Glukhov <[email protected]> wrote:
> You can simply use jsonb_object_agg() to build a jsonb object from a sequence
> of transformed key-value pairs:

<strikes forehead> I've even used that function before. :-) I tried
finding it on the JSON functions page but couldn't, so I thought maybe
I was going crazy. Of course it's on the aggregates page instead. As I
said it was late at night. :-) Your version works perfectly!

Even still, it may be nice to have a non-aggregate function that lets
you build nested JSON. But I agree jsonb_object_agg makes it less
needful.

Thanks!
Paul





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

* Re: Add json_object(text[], json[])?
  2019-10-24 15:17 Add json_object(text[], json[])? Paul Jungwirth <[email protected]>
  2019-10-24 15:42 ` Re: Add json_object(text[], json[])? Nikita Glukhov <[email protected]>
  2019-10-24 16:46   ` Re: Add json_object(text[], json[])? Paul A Jungwirth <[email protected]>
@ 2019-10-25 13:40     ` Andrew Dunstan <[email protected]>
  2019-10-25 18:32       ` Re: Add json_object(text[], json[])? Paul Jungwirth <[email protected]>
  0 siblings, 1 reply; 1933+ messages in thread

From: Andrew Dunstan @ 2019-10-25 13:40 UTC (permalink / raw)
  To: Paul A Jungwirth <[email protected]>; Nikita Glukhov <[email protected]>; +Cc: pgsql-hackers


On 10/24/19 12:46 PM, Paul A Jungwirth wrote:
>
> Even still, it may be nice to have a non-aggregate function that lets
> you build nested JSON. But I agree jsonb_object_agg makes it less
> needful.
>


json{b}_build_object and json{b}_build_array are designed for creating
nested json{b}. Not sure if they would work for your purpose. I hadn't
considered something to let you transform keys.


PLV8 is useful for doing more outlandish JSON transformations. Maybe the
Underscore library has something that would be useful here.


cheers


andrew


-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services






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

* Re: Add json_object(text[], json[])?
  2019-10-24 15:17 Add json_object(text[], json[])? Paul Jungwirth <[email protected]>
  2019-10-24 15:42 ` Re: Add json_object(text[], json[])? Nikita Glukhov <[email protected]>
  2019-10-24 16:46   ` Re: Add json_object(text[], json[])? Paul A Jungwirth <[email protected]>
  2019-10-25 13:40     ` Re: Add json_object(text[], json[])? Andrew Dunstan <[email protected]>
@ 2019-10-25 18:32       ` Paul Jungwirth <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Paul Jungwirth @ 2019-10-25 18:32 UTC (permalink / raw)
  To: Andrew Dunstan <[email protected]>; Nikita Glukhov <[email protected]>; +Cc: pgsql-hackers

On 10/25/19 6:40 AM, Andrew Dunstan wrote:
> json{b}_build_object and json{b}_build_array are designed for creating
> nested json{b}. Not sure if they would work for your purpose.

Thanks for the suggestion! I looked at these a bit, but they only work 
if you have a known-ahead-of-time number of arguments. (I did explore 
building an array and calling jsonb_build_object using VARIADIC, but you 
can't build an array with alternating text & jsonb elements. That made 
me curious how these functions even worked, which led me to 
extract_variadic_args (utils/fmgr/funcapi.c), which has some magic to 
support heterogeneous types when not called with the VARIADIC keyword, 
so it seems they bypass the normal variadic handling.)

Regards,

-- 
Paul              ~{:-)
[email protected]





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

* Re: Add json_object(text[], json[])?
  2019-10-24 15:17 Add json_object(text[], json[])? Paul Jungwirth <[email protected]>
@ 2019-10-24 15:52 ` Tom Lane <[email protected]>
  2019-10-24 16:37   ` Re: Add json_object(text[], json[])? Paul A Jungwirth <[email protected]>
  1 sibling, 1 reply; 1933+ messages in thread

From: Tom Lane @ 2019-10-24 15:52 UTC (permalink / raw)
  To: Paul Jungwirth <[email protected]>; +Cc: pgsql-hackers

Paul Jungwirth <[email protected]> writes:
> I noticed that our existing 2-param json{,b}_object functions take 
> text[] for both keys and values, so they are only able to build 
> one-layer-deep JSON objects. I'm interested in adding json{,b}_object 
> functions that take text[] for the keys and json{,b}[] for the values. 
> It would otherwise behave the same as json_object(text[], text[]) (e.g. 
> re NULL handling). Does that seem worthwhile to anyone?

I think a potential problem is creation of ambiguity where there was
none before.  I prototyped this as

regression=# create function jsonb_object(text[], jsonb[]) returns jsonb
as 'select jsonb_object($1, $2::text[])' language sql;
CREATE FUNCTION

and immediately got

regression=# explain select jsonb_object('{a}', '{b}');
ERROR:  function jsonb_object(unknown, unknown) is not unique
LINE 1: explain select jsonb_object('{a}', '{b}');
                       ^
HINT:  Could not choose a best candidate function. You might need to add explicit type casts.

which is something that works fine as long as there's only one
jsonb_object().  I'm not sure whether that's a big problem in
practice --- it seems like it will resolve successfully as long
as at least one input isn't an unknown literal.  But it could be
a problem for prepared statements, or clients using APIs that
involve prepared statements under the hood:

regression=# prepare foo as select jsonb_object($1,$2);
ERROR:  function jsonb_object(unknown, unknown) is not unique

Also, as the prototype implementation shows, it's not like you
can't get this functionality today ... you just need to cast
jsonb to text.  Admittedly that's annoying and wasteful.

			regards, tom lane





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

* Re: Add json_object(text[], json[])?
  2019-10-24 15:17 Add json_object(text[], json[])? Paul Jungwirth <[email protected]>
  2019-10-24 15:52 ` Re: Add json_object(text[], json[])? Tom Lane <[email protected]>
@ 2019-10-24 16:37   ` Paul A Jungwirth <[email protected]>
  2019-10-24 17:06     ` Re: Add json_object(text[], json[])? Tom Lane <[email protected]>
  0 siblings, 1 reply; 1933+ messages in thread

From: Paul A Jungwirth @ 2019-10-24 16:37 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; +Cc: pgsql-hackers

On Thu, Oct 24, 2019 at 8:52 AM Tom Lane <[email protected]> wrote:
> I think a potential problem is creation of ambiguity where there was
> none before.

I agree that's not nice, and it seems like a new name might be better.

> Also, as the prototype implementation shows, it's not like you
> can't get this functionality today ... you just need to cast
> jsonb to text.  Admittedly that's annoying and wasteful.

I don't think that gives the same result, does it? For example:

# select jsonb_object(array['foo'], array['[{"bar-bar": ["baz"]}]'::jsonb]);
             jsonb_object
---------------------------------------
 {"foo": "[{\"bar-bar\": [\"baz\"]}]"}

You can see the values are JSON strings, not JSON arrays/objects/etc.

Regards,
Paul





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

* Re: Add json_object(text[], json[])?
  2019-10-24 15:17 Add json_object(text[], json[])? Paul Jungwirth <[email protected]>
  2019-10-24 15:52 ` Re: Add json_object(text[], json[])? Tom Lane <[email protected]>
  2019-10-24 16:37   ` Re: Add json_object(text[], json[])? Paul A Jungwirth <[email protected]>
@ 2019-10-24 17:06     ` Tom Lane <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Tom Lane @ 2019-10-24 17:06 UTC (permalink / raw)
  To: Paul A Jungwirth <[email protected]>; +Cc: pgsql-hackers

Paul A Jungwirth <[email protected]> writes:
> On Thu, Oct 24, 2019 at 8:52 AM Tom Lane <[email protected]> wrote:
>> Also, as the prototype implementation shows, it's not like you
>> can't get this functionality today ... you just need to cast
>> jsonb to text.  Admittedly that's annoying and wasteful.

> I don't think that gives the same result, does it?

Ah, you're right --- ENOCAFFEINE :-(.

			regards, tom lane





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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1933+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1933+ messages in thread


end of thread, other threads:[~2026-04-03 19:08 UTC | newest]

Thread overview: 1933+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-10-24 15:17 Add json_object(text[], json[])? Paul Jungwirth <[email protected]>
2019-10-24 15:42 ` Nikita Glukhov <[email protected]>
2019-10-24 16:46   ` Paul A Jungwirth <[email protected]>
2019-10-25 13:40     ` Andrew Dunstan <[email protected]>
2019-10-25 18:32       ` Paul Jungwirth <[email protected]>
2019-10-24 15:52 ` Tom Lane <[email protected]>
2019-10-24 16:37   ` Paul A Jungwirth <[email protected]>
2019-10-24 17:06     ` Tom Lane <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 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 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 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 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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 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 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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 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 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 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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 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 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 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 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 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 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 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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 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 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 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 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 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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 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 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 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 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 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 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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 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 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 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 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 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 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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 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 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 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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 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 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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 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 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 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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 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 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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 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 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 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 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 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 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 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 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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 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 v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-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 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 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 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 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 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 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 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 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 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]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox